/*
package JavaCode_公开课.src.JavaCodePublicClass.录屏;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class JavaCodePublicClass.录屏 {
    public static void main(String[] args) throws IOException {
        try {
            for (int i = 0; i < 20; i++) {
                getImage("D:\\jfsafjka\\kjefksjbfjk" + i + ".jpg");
                Thread.sleep(10);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
//        创建操作对象
        AbstractMethodError encoder = new AbstractMethodError();
//        将整个gif启动
        encoder.start("D:\\jfsafjka\\kjefksjbfjk/5.gif");

        BufferedImage[] src = new BufferedImage[10];
        try {
            int k = 0;
            for (int i = 0; i < 10; i++) {
                k = i + 1;
                encoder.setDelay(100);
                src[i] = ImageIO.read(new File("D:\\jfsafjka\\kjefksjbfjk/5.gif" + k + ".jpg"));
//               将内存种的图片放到gif里面帧
                encoder.addFrame(src[i]);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void getImage(String filePath) {
        try {
//            获取当前屏幕从X,Y开始    长宽给定的屏幕画面
            BufferedImage bufferedImage = new Robot().createScreenCapture(new Rectangle(0, 0, 1366, 768));
            File file = new File(filePath);
            ImageIO.write(bufferedImage, "jpg", file);
        } catch (AWTException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
*/
